package com.luculent.base.section;

import java.io.UnsupportedEncodingException;

import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;

import com.luculent.base.Send;

public class FPJRSend extends Send{ 
	public String host = "http://cpadis.cpad.gov.cn:9200";
	public String method = "/cpad_coop/page/excute";
	public String account;
	public String token;
	
	public HttpPost getPost(String nowTime,String account,String content,String condition) throws UnsupportedEncodingException{
			
		String url = host+method; 
        HttpPost httpPost = new HttpPost(url);       
        httpPost.setHeader("Content-Type", "application/json;charset=UTF-8"); 
        httpPost.setHeader("Accept", "application/json, text/plain, */*"); 
        httpPost.setHeader("Host", "cpadis.cpad.gov.cn:9200");
        httpPost.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36");
        httpPost.setHeader("Content-Type", "application/json;charset=utf-8"); 
        httpPost.setHeader("X-MICRO-TIME", nowTime);
        httpPost.setHeader("X-USER",account);
        httpPost.setHeader("X-HMAC-HASH",content); 
        StringEntity se = new StringEntity(condition);
        se.setContentType("application/x-www-form-urlencoded; charset=utf-8"); 
        httpPost.setEntity(se);
        return httpPost; 
	}
}
